package com.gitee.wsl.doc.html.selects

import com.gitee.wsl.doc.soup.CssSelectable
import com.gitee.wsl.doc.soup.CssSelector

/**
 * Will define a <applet>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
 fun <T> CssSelectable.applet(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("applet$cssSelector", init)

/**
 * Will define a <embed>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
public fun <T> CssSelectable.embed(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("embed$cssSelector", init)

/**
 * Will define a <iframe>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
public fun <T> CssSelectable.iframe(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("iframe$cssSelector", init)

/**
 * Will define a <noembed>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
public fun <T> CssSelectable.noembed(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("noembed$cssSelector", init)

/**
 * Will define a <object>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
@Suppress("FunctionNaming")
public fun <T> CssSelectable.`object`(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("object$cssSelector", init)

/**
 * Will define a <param>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
public fun <T> CssSelectable.param(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("param$cssSelector", init)

/**
 * Will define a <picture>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
public fun <T> CssSelectable.picture(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("picture$cssSelector", init)

/**
 * Will define a <source>-tags css query selector.
 * By default, it will just be the specific tag-name.
 * It is possible to define a more concrete selector by using the provided fields of the CssSelector object or
 * by passing a raw css query selector as parameter.
 * If a selector is passed as parameter as well as be defined via CssSelector fields, they will be merged.
 * @see CssSelector
 * @param cssSelector
 * @return T
 */
public fun <T> CssSelectable.source(cssSelector: String = "", init: CssSelector.() -> T): T =
    selection("source$cssSelector", init)
